<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>逻辑操作符</title>
</head>
<body>
    <h2>这是and操作符</h2>
    {% for a in alist %}
        {% if a and True %}
        <div>第{{ forloop.counter }}次循环, 值为真</div>
        {% else %}
        <div>第{{ forloop.counter }}次循环, 值不为真</div>
        {% endif %}
    {% endfor %}
    <hr>
    <h2>这是or操作符</h2>
    {% for a in alist %}
        {% if a or False %}
        <div>第{{ forloop.counter }}次循环, 值为真</div>
        {% else %}
        <div>第{{ forloop.counter }}次循环, 值不为真</div>
        {% endif %}
    {% endfor %}
    <hr>
    <h2>这是not操作符</h2>
    {% for a in alist %}
        {% if not a %}
        <div>第{{ forloop.counter }}次循环, 值不为真</div>
        {% else %}
        <div>第{{ forloop.counter }}次循环, 值为真</div>
        {% endif %}
    {% endfor %}
    <hr>
</body>
</html>